import { Get, Post, Delete } from "../server";
import { LoadingPost, LoadingGet } from "../loadingServer";

export function getUserInfo(billId) {
  return Get("/biz/SRMOrder/GetDetail", { billId });
}

// 工作台获取
// export function OpenWeatherMapApi(data) {
//   return Get("/data/3.0/onecall", data);
//   // return Get("https://api.openweathermap.org/data/3.0/onecall", data);
// }

export function OpenWeatherMapApi(data) {
  return Get(
    "/data/2.5/forecast?q=beijing&appid=67e7b0e93a166d242087d85545bcb8ea",
    data
  );
  // return Get("https://api.openweathermap.org/data/3.0/onecall", data);
}

//利用率
export function getNdsdUsageAPI(data) {
  return Get("/ndsd/loc/usage", data);
}
// 本月出入库变化曲线
export function getNdsdCurveAPI(data) {
  return Get("/ndsd/inoutbound/change/curve", data);
}
// 当日入库订单情况
export function getNdsdInboundInfosAPI(data) {
  return Get("/ndsd/today/inbound/infos", data);
}
export function getNdsdOutboundInfosAPI(data) {
  return Get("/ndsd/today/outbound/infos", data);
}
// 重要指标参数
export function getNdsdImportantParamsAPI(data) {
  return Get("/ndsd/important/params", data);
}
// 当日出入库统计
export function getNdsdPerhourAPI(data) {
  return Get("/ndsd/today/inoutbound/perhour/infos", data);
}
//
export function getNdsdTotalTimeAPI(data) {
  return Get("/ndsd/today/inoutbound/totaltime", data);
}
//近一年出入库统计
export function getNdsdPastyearAPI(data) {
  return Get("/ndsd/pastyear/inoutbound/infos", data);
}
export function runSqlAPI(data) {
  return Get("/api/public/run-sql", data);
}

export function getStationsPointsAPI(data) {
  return Get("/gui/wcsz/v1/kb/stations", data);
}
// /gui/wcsz/v1/productlines/points
// 查询指定工位托盘信息(精定位)
export function getJDWCidsInfoAPI(data) {
  return Get("/gui/wcsz/v1/jdw/cids/info", data);
}
export function getO2mProductlinesAPI(data) {
  return Get("/gui/wcsz/v1/o2m/productlines", data);
}
export function getO2mPointsAPI(data) {
  return Get("/gui/wcsz/v1/o2m/points", data);
}
export function getCidsInfoAPI(data) {
  return Get("/gui/wcsz/v1/o2m/cids/info", data);
}
export function getPickInfoAPI(data) {
  return Get("/gui/wcsz/v1/o2m/pick/info", data);
}

// 查询生产计划任务
export function getProduceplansAPI(data) {
  return Get("/gui/wcsz/v1/kb/tasks", data);
}

// 查询生产计划任务
export function getProduceplansSortAPI(data) {
  return Get("/gui/wcsz/v1/kb/current/pickinfo", data);
}
export function getProduceplansLoadingSortAPI(data) {
  return LoadingGet("/gui/wcsz/o2m/produceplans/sort", data);
}

// 查询活跃的投料任务
export function getPointtasksAPI(data) {
  return Get("/gui/wcsz/v1/kb/locationid/taskinfo", data);
}

// 查询工位操作记录
export function getScanInfoAPI(data) {
  return Get("/gui/wcsz/v1/kb/scans", data);
}

// 登录
export function loginAPI(data) {
  return Post("/gui/wcsz/v1/o2m/login", data);
}

// planPullBreakupAPI
export function planPullBreakupAPI(data) {
  return Post("/gui/wcsz/v1/plan/pull/O2M", data);
}

// 托盘库位绑定
export function cidLocationBindAPI(data) {
  return Post("/gui/wcsz/v1/cid/locationid/bind", data);
}

// 关键件扫描完成
export function keyflagCompleteAPI(data) {
  return LoadingPost("/gui/wcsz/v1/keyflag/complete", data);
}
// 关键件扫描完成
export function CidBindAPI(data) {
  return LoadingPost("/gui/wcsz/v1/kb/cidbind", data);
}

// 物料车关键件扫描完成
export function keyflagMCCompleteAPI(data) {
  return LoadingPost("/gui/wcsz/v1/o2m/keyflag/complete", data);
}

// 关键件扫描完成修改
export function keyflagCompleteChangeAPI(data) {
  return LoadingPost("/gui/wcsz/v1/keyflag/complete/change", data);
}

// 关键件扫描跳过
export function keyflagSkiponeAPI(data) {
  return LoadingPost("/gui/wcsz/v1/keyflag/skipone", data);
}

// 关键件扫描跳过
export function keyflagSkiponeGKAPI(data) {
  return LoadingPost("/gui/wcsz/v1/pallet/bin/skip", data);
}

// 物料车关键件扫描跳过
export function keyflagMCSkiponeAPI(data) {
  return LoadingPost("/gui/wcsz/v1/o2m/keyflag/skipone", data);
}
// 编辑关键件扫描跳过
export function keyflagSkiponeChangeAPI(data) {
  return LoadingPost("/gui/wcsz/v1/keyflag/skipone/change ", data);
}

// 非关键件下一步
export function unkeyflagNextstepAPI(data) {
  return LoadingPost("/gui/wcsz/v1/unkeyflag/nextstep", data);
}
// 物料车下一步
export function unkeyflagMCNextstepAPI(data) {
  return LoadingPost("/gui/wcsz/v1/mc/unkeyflag/nextstep", data);
}

// AB换面
export function ABchangeAPI(data) {
  return Post("/gui/wcsz/v1/pallet/operation", data);
}

// 退空投料点器具
export function cidEmpty(data) {
  return Post("/gui/wcsz/v1/cid/empty", data);
}
// 退空投料点器具
export function cidO2mEmpty(data) {
  return Post("/gui/wcsz/v1/o2m/empty/cid", data);
}

// 工位托盘清空
export function delCidScan(data) {
  return Post("/gui/wcsz/v1/cid/scan/infos/delete", data);
}

// 工位托盘完成
export function cidFull(data) {
  return LoadingPost("/gui/wcsz/v1/kb/pick", data);
}
// 输送线启停

export function Transit_PLC_API(data) {
  return LoadingPost("/Transit_PLC/", data);
}

// 物料车工位托盘完成
export function cidMCFull(data) {
  return LoadingPost("/gui/wcsz/v1/o2m/cid/full", data);
}

// 物料车单层保存
export function scanMCSave(data) {
  return LoadingPost("/gui/wcsz/v1/o2m/scan/save", data);
}

// 投料激活
export function pointtasksActivationAPI(data) {
  return Post("/gui/wcsz/v1/pointtasks/activation", data);
}

export const userApi = {
  getUserInfo,
  loginAPI,
  getStationsPointsAPI,
  getCidsInfoAPI,
  getPickInfoAPI,
  getO2mProductlinesAPI,
  getO2mPointsAPI,
  cidLocationBindAPI,
  getProduceplansAPI,
  getProduceplansSortAPI,
  getProduceplansLoadingSortAPI,
  keyflagCompleteAPI,
  keyflagMCCompleteAPI,
  keyflagCompleteChangeAPI,
  keyflagSkiponeAPI,
  keyflagMCSkiponeAPI,
  keyflagSkiponeChangeAPI,
  keyflagSkiponeGKAPI,
  unkeyflagNextstepAPI,
  unkeyflagMCNextstepAPI,
  getPointtasksAPI,
  ABchangeAPI,
  getScanInfoAPI,
  delCidScan,
  cidEmpty,
  cidO2mEmpty,
  cidFull,
  cidMCFull,
  scanMCSave,
  pointtasksActivationAPI,
  planPullBreakupAPI,
  Transit_PLC_API,
  CidBindAPI,
  getJDWCidsInfoAPI,
  OpenWeatherMapApi,

  getNdsdUsageAPI,
  getNdsdCurveAPI,
  getNdsdInboundInfosAPI,
  getNdsdImportantParamsAPI,
  getNdsdOutboundInfosAPI,
  getNdsdPerhourAPI,
  getNdsdTotalTimeAPI,
  getNdsdPastyearAPI,
  runSqlAPI,
};

// {"code": 0, "data": [{"ProductOrder": 1, "ProductCode": "Code1", "Model": "1", "OrderNo": "\u5de5\u53551", "SkuId": "444", "SkuName": "444", "Qty": 1.0, "KeyFlag": "\u662f", "BOMID": "1", "Status": "10"}, {"ProductOrder": 2, "ProductCode": "Code1", "Model": "1", "OrderNo": "\u5de5\u53552", "SkuId": "0056", "SkuName": "0056", "Qty": 1.0, "KeyFlag": "\u662f", "BOMID": "1", "Status": "10"}, {"ProductOrder": 3, "ProductCode": "Code1", "Model": "1", "OrderNo": "\u5de5\u53553", "SkuId": "0078", "SkuName": "0078", "Qty": 1.0, "KeyFlag": "\u662f", "BOMID": "1", "Status": "10"}, {"ProductOrder": 4, "ProductCode": "Code1", "Model": "1", "OrderNo": "\u5de5\u53554", "SkuId": "333", "SkuName": "333", "Qty": 1.0, "KeyFlag": "\u662f", "BOMID": "1", "Status": "10"}, {"ProductOrder": 5, "ProductCode": "Code1", "Model": "1", "OrderNo": "\u5de5\u53555", "SkuId": "SKU001", "SkuName": "SKU001", "Qty": 2.0, "KeyFlag": "\u5426", "BOMID": "2", "Status": "10"}, {"ProductOrder": 6, "ProductCode": "Code1", "Model": "1", "OrderNo": "\u5de5\u53556", "SkuId": "555", "SkuName": "555", "Qty": 1.0, "KeyFlag": "\u662f", "BOMID": "1", "Status": "10"}, {"ProductOrder": 7, "ProductCode": "Code1", "Model": "1", "OrderNo": "\u5de5\u53557", "SkuId": "SKU002", "SkuName": "SKU002", "Qty": 1.0, "KeyFlag": "\u662f", "BOMID": "1", "Status": "10"}, {"ProductOrder": 8, "ProductCode": "Code1", "Model": "1", "OrderNo": "\u5de5\u53558", "SkuId": "0088", "SkuName": "0088", "Qty": 3.0, "KeyFlag": "\u662f", "BOMID": "3", "Status": "10"}, {"ProductOrder": 9, "ProductCode": "Code1", "Model": "1", "OrderNo": "\u5de5\u53559", "SkuId": "0099", "SkuName": "0099", "Qty": 2.0, "KeyFlag": "\u662f", "BOMID": "4", "Status": "10"}, {"ProductOrder": 10, "ProductCode": "Code1", "Model": "1", "OrderNo": "\u5de5\u535510", "SkuId": "0000", "SkuName": "0000", "Qty": 4.0, "KeyFlag": "\u662f", "BOMID": "5", "Status": "10"}, {"ProductOrder": 11, "ProductCode": "Code1", "Model": "1", "OrderNo": "\u5de5\u535512", "SkuId": "2222", "SkuName": "2222", "Qty": 5.0, "KeyFlag": "\u662f", "BOMID": "7", "Status": "10"}, {"ProductOrder": 12, "ProductCode": "Code1", "Model": "1", "OrderNo": "\u5de5\u535513", "SkuId": "3333", "SkuName": "3333", "Qty": 3.0, "KeyFlag": "\u662f", "BOMID": "8", "Status": "10"}, {"ProductOrder": 13, "ProductCode": "Code1", "Model": "1", "OrderNo": "\u5de5\u535514", "SkuId": "4444", "SkuName": "4444", "Qty": 2.0, "KeyFlag": "\u5426", "BOMID": "9", "Status": "10"}, {"ProductOrder": 14, "ProductCode": "Code1", "Model": "1", "OrderNo": "\u5de5\u535515", "SkuId": "5555", "SkuName": "5555", "Qty": 3.0, "KeyFlag": "\u5426", "BOMID": "10", "Status": "10"}, {"ProductOrder": 15, "ProductCode": "Code1", "Model": "1", "OrderNo": "\u5de5\u535516", "SkuId": "6666", "SkuName": "6666", "Qty": 4.0, "KeyFlag": "\u5426", "BOMID": "11", "Status": "10"}, {"ProductOrder": 16, "ProductCode": "Code1", "Model": "1", "OrderNo": "\u5de5\u535517", "SkuId": "7777", "SkuName": "7777", "Qty": 3.0, "KeyFlag": "\u662f", "BOMID": "12", "Status": "10"}, {"ProductOrder": 17, "ProductCode": "Code1", "Model": "1", "OrderNo": "\u5de5\u535518", "SkuId": "8888", "SkuName": "8888", "Qty": 6.0, "KeyFlag": "\u662f", "BOMID": "13", "Status": "10"}, {"ProductOrder": 18, "ProductCode": "Code1", "Model": "1", "OrderNo": "\u5de5\u535519", "SkuId": "8899", "SkuName": "8899", "Qty": 4.0, "KeyFlag": "\u662f", "BOMID": "14", "Status": "10"}, {"ProductOrder": 19, "ProductCode": "Code1", "Model": "1", "OrderNo": "\u5de5\u535520", "SkuId": "9999", "SkuName": "9999", "Qty": 3.0, "KeyFlag": "\u662f", "BOMID": "15", "Status": "10"}, {"ProductOrder": 20, "ProductCode": "Code1", "Model": "1", "OrderNo": "\u5de5\u535521", "SkuId": "11111", "SkuName": "11111", "Qty": 4.0, "KeyFlag": "\u662f", "BOMID": "16", "Status": "10"}], "message": "\u6210\u529f", "totalcount": 33}
